<template>
    <div class="mean">
        <div class="meanItem" @click="gotoPath('/')">
            <img :src="tabbar_home_icon" v-if="router.currentRoute.value.fullPath == '/'"/>
            <img :src="tabbar_home_icon_default" v-else/>
            <div>For You</div>
        </div>
        <div class="meanItem" @click="gotoPath('/createRecipes')">
            <img :src="tabbar_add_icon" v-if="router.currentRoute.value.fullPath == '/createRecipes'"/>
            <img :src="tabbar_add_icon_default" v-else/>
            <div>Add</div>
        </div>
        <div class="meanItem" @click="gotoPath('/plan')">
            <img :src="tabbar_mealplan_icon" v-if="router.currentRoute.value.fullPath == '/plan'"/>
            <img :src="tabbar_mealplan_icon_default" v-else/>
            <div>Meal Plan</div>
        </div>
    </div>
</template>
<script setup>
import tabbar_home_icon from '../assets/tabbar_home_icon.png'
import tabbar_home_icon_default from '../assets/tabbar_home_icon_default.png'
import tabbar_add_icon from '../assets/tabbar_add_icon.png'
import tabbar_add_icon_default from '../assets/tabbar_add_icon_default.png'
import tabbar_mealplan_icon from '../assets/tabbar_mealplan_icon.png'
import tabbar_mealplan_icon_default from '../assets/tabbar_mealplan_icon_default.png'
import { useRouter } from 'vue-router';
const router = useRouter()
const gotoPath = (path) => {
    if (path == router.currentRoute.value.fullPath) return
    router.push(path)
}
</script>
<style scoped>
.mean {
    position: fixed;
    bottom: 17px;
    left: 0;
    width: 100%;
    height: 11vh;
    display: flex;
    justify-content: space-around;
    align-items: center;
}
.meanItem {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    font-weight: 500;
    font-size: 14px;
    color: #000000;
    height: 100%;
}
.meanItem>img {
    width: 49px;
    height: 49px;
}
</style>